package com.example.article.job;

import com.example.article.service.HotArticleService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ComputerArticleJob {

    @Autowired
    private HotArticleService hotArticleService;

    @XxlJob("demoJobHandler")
    public void handle(){
        System.out.println("简单任务执行了。。。。");
        hotArticleService.computeArticle();
        System.out.println("简单任务执行结束了。。。。");
    }
}
